﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Demo.Demos.TravelRequest.TravelRequest"
    MasterPageFile="~/Example.Master" %>

<asp:Content runat="server" ContentPlaceHolderID="MainContent">
    <p>
        <i>You can also download matching InfoPath 2007 form Microsoft template gallery. (<a
            href="TravelRequest.xsn">copy stored here</a>)</i>
    </p>
    <asp:UpdatePanel runat="server">
        <ContentTemplate>
            <d:TravelDataContextControl ID="ctrl_DataContext" runat="server">
                <div class="tr">
                    <div class="tr-title">
                        TRAVEL REQUEST</div>
                    <div class="tr-header">
                        <div class="row-fluid">
                            <div class="span8">
                                <span class="tr-label">Business Purpose:</span><br />
                                <cwfj:simpleeditor runat="server" datapath="BusinessPurpose" Width="500" CanBeNull="false"/>
                            </div>
                            <div>
                                <span class="tr-label">Request Date:</span><br />
                                <cwfj:simpleeditor runat="server" datapath="RequestDate" showdate="true" CanBeNull="false"/>
                            </div>
                        </div>
                    </div>
                    <div class="tr-body">
                        <div class="tr-travler">
                            <h4>
                                Traveler Information</h4>
                                <hr />
                            <div class="row-fluid">
                                <div class="span6">
                                    <span class="tr-label">Name:</span>
                                    <cwfj:simpleeditor runat="server" datapath="TravelerName" CanBeNull="false"/>
                                </div>
                                <div class="span6">
                                    <span class="tr-label">E-mail Address:</span>
                                    <cwfj:emaileditor runat="server" datapath="EmailAddress" canbenull="true" />
                                </div>
                            </div>
                        </div>
                        <div class="tr-trips">
                            <h4>
                                Trips</h4>
                            <hr />
                            <cwf:CollectionEditor runat="server" DataPath="Trips">
                                <ItemTemplate>
                                    <div class="tr-trip">
                                        <div class="tr-trip-header">
                                            TRIP
                                            <asp:Button runat="server" CssClass="btn btn-mini" CommandName="Remove" Text="Remove" />
                                        </div>
                                        <div class="tr-trip-body">
                                            <div class="row-fluid">
                                                <div class="span6">
                                                    <span class="tr-label">From:</span><br />
                                                    <cwfj:simpleeditor runat="server" datapath="From" Width="350" CanBeNull="false" />
                                                    <br />
                                                    <span class="tr-label">Departure date/time</span><br />
                                                    <cwfj:simpleeditor runat="Server" datapath="DepartureDate" showdate="true" showtime="true" CanBeNull="false" />
                                                    <br />
                                                    <cwfj:simpleeditor runat="server" datapath="RoundTrip" autopostback="true" />
                                                    <span class="tr-label">Round trip</span><br />
                                                    <cwf:IfElsePanel runat="server" ConditionDataPath="RoundTrip">
                                                        <IfTemplate>
                                                            <span class="tr-label">Return date/time</span><br />
                                                            <cwfj:simpleeditor runat="Server" datapath="ReturnDate" showdate="true" showtime="true" CanBeNull="false" />
                                                            <br />
                                                        </IfTemplate>
                                                    </cwf:IfElsePanel>
                                                </div>
                                                <div class="span6">
                                                    <span class="tr-label">To:</span><br />
                                                    <cwfj:simpleeditor runat="server" datapath="To" Width="350" CanBeNull="false" />
                                                    <br />
                                                    <cwfj:simpleeditor runat="server" datapath="IncludeHotel" />
                                                    <span class="tr-label">Include hotel</span><br />
                                                    <cwfj:simpleeditor runat="server" datapath="IncludeCarRental" />
                                                    <span class="tr-label">Include car rental</span><br />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </cwf:CollectionEditor>
                            <asp:Button runat="server" ID="Add" OnClick="Click_AddTrip" Text="Add" CssClass="btn btn-mini" />
                        </div>
                        <h4 class="tr-preferences">
                            Preferences</h4>
                        <hr />
                        <div class="row-fluid">
                            <div class="span6">
                                <span class="tr-label">Trip Class:</span><br />
                                <cwfj:listeditor runat="server" datapath="TripClassDropDown" CanBeNull="false" />
                                <br />
                                <span class="tr-label">Seat Location:</span><br />
                                <cwfj:listeditor runat="server" datapath="SeatLocationDropDown" CanBeNull="false" />
                                <br />
                            </div>
                            <div class="span6">
                                <span class="tr-label">Car Class:</span><br />
                                <cwfj:listeditor runat="server" datapath="CarClassDropDown" CanBeNull="false" />
                                <br />
                                <cwfj:simpleeditor runat="server" datapath="NonSmokingHotelRoomRequired" />
                                <span class="tr-label">Non-smoking hotel room required</span>
                            </div>
                        </div>
                        <hr />
                        <h4>
                            Notes</h4>
                        <cwfj:simpleeditor runat="server" datapath="Notes" textmode="Multiline" height="100"
                            width="700" canbenull="true" />
                    </div>
                    <div class="form-actions">
                        <asp:Button ID="Button1" runat="server" OnClick="Save_Click" Text="Save" CssClass="btn" />
                    </div>
                </div>
            </d:TravelDataContextControl>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
